namespace UniversalAdminSystem.Domian.FileStorage.ValueObjects;

public record FileType
{
    public string Value { get; }
    public static readonly string[] AllowedTypes = new[] { "jpg", "jpeg", "png", ".gif", ".bmp", ".pdf", ".doc", ".docx", ".xls", ".xlsx", ".txt", ".zip", ".rar" };
    private FileType(string value)
    {
        if (string.IsNullOrWhiteSpace(value)) throw new ArgumentException("文件类型不能为空");
        // if (!AllowedTypes.Contains(value.ToLower()))
        //     throw new ArgumentException($"不支持的文件类型: {value}");
        Value = value.ToLower();
    }
    public static FileType Create(string value) => new(value);
    public static implicit operator string(FileType type) => type.Value;
} 